using net_work.Data.Enum.Appr;
using net_work.Data.Enum.System;

namespace net_work.Data.DTO.Appr;

public class ApprovalSubmitInfo
{
    // 基本信息
    /// <summary>
    /// 流程ID
    /// </summary>
    public required long FlowId { get; set; }

    /// <summary>
    /// 审批实例ID
    /// </summary>
    public required long InstId { get; set; }

    /// <summary>
    /// 当前审批节点ID
    /// </summary>
    public required long NodeId { get; set; }

    // 审批人信息
    /// <summary>
    /// 提交人ID
    /// </summary>
    public required long SubmitterId { get; set; }

    /// <summary>
    /// 提交人角色
    /// </summary>
    public required string SubmitterRole { get; set; }

    /// <summary>
    /// 提交人部门ID（可选）
    /// </summary>
    public long? SubmitterDeptId { get; set; }

    // 业务信息
    /// <summary>
    /// 业务类型（硬编码）
    /// </summary>
    public required BusinessType BusinessCode { get; set; }

    /// <summary>
    /// 业务关联的实体ID
    /// </summary>
    public required long BusinessEntityId { get; set; }

    // 节点相关信息
    /// <summary>
    /// 节点处理对象的类型（例如：部门、用户）
    /// </summary>
    public required NodeProcessingType ProcessingType { get; set; }

    /// <summary>
    /// 节点处理对象的ID
    /// </summary>
    public required long ProcessingId { get; set; }

    /// <summary>
    /// 节点通过依据类型（如：OnlyOne、All）
    /// </summary>
    public required NodeSuccessType SuccessType { get; set; }

    /// <summary>
    /// 节点通过依据的配置（适用于 Number 和 PCT）
    /// </summary>
    public long? SuccessConfig { get; set; }

    // 动态判断信息
    /// <summary>
    /// 总待审批人数
    /// </summary>
    public required int TaskTotalCount { get; set; }

    /// <summary>
    /// 当前已通过审批的数量
    /// </summary>
    public required int ApprovedCount { get; set; }
    
    /// <summary>
    /// 当前未通过审批的数量
    /// </summary>
    public required int UnApprovedCount { get; set; }

    // 结果信息
    /// <summary>
    /// 是否要进行跳转
    /// </summary>
    public bool IsSkip { get; set; } = false;

    /// <summary>
    /// 跳转方向：通过、不通过
    /// </summary>
    public bool? SkipResult { get; set; }
    
    /// <summary>
    /// 是否已经处理过
    /// </summary>
    public  bool HasHandled{get;set;} = false;
}